<%@page import="java.awt.print.Printable"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
<title>_${customer.customerName}_发货任务</title>
<script language="javascript" type="text/javascript" src="${ctx}/static/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
  $(function() {
		$("#queryForm").validate(); 
  });
</script>
</head>

<body>

	<table class="table table-striped table-bordered table-condensed" style="margin-top: 0px;">
		<thead>
			<th style="vertical-align: middle; color: white; " colspan="1" bgcolor="#8EB4CB">条件查询</th>
		</thead>
		<tr >
		   <td>
		     
		     <form class="form-search" id="queryForm" method="post" action="${ctx}/pkgTask/queryPkgTask" style="margin-top: 10px;">
			 	
			 	<label style="margin-left: 10px;">批次类型:</label>
				<select class="input-medium"  id="_batchType" name="_batchType">
				        <option value="" <c:if test="${param._batchType eq ''}">selected="selected"</c:if>>全选</option>
				        <option value="wms" <c:if test="${param._batchType eq 'wms'}">selected="selected"</c:if>>商发宝</option>
				        <option value="tms" <c:if test="${param._batchType eq 'tms'}">selected="selected"</c:if>>集发宝</option>
				        <option value="bms" <c:if test="${param._batchType eq 'bms'}">selected="selected"</c:if>>分仓宝</option>
				</select> 
			 	 
			 	<label style="margin-left: 10px;">拣货类型:</label>
				<select class="input-medium"  id="_pickType" name="_pickType">
				        <option value="" <c:if test="${param._pickType eq ''}">selected="selected"</c:if>>全选</option>
				        <option value="single" <c:if test="${param._pickType eq 'single'}">selected="selected"</c:if>>单件</option>
				        <option value="multi" <c:if test="${param._pickType eq 'multi'}">selected="selected"</c:if>>多件</option>
				</select>
				
				<label style="margin-left: 10px;">拣货仓库</label>
				 <select  name="_warehouseCode"  id="_warehouseCode" value="${param._warehouseCode}"  class="input-medium">
					<option value=""></option>
					<c:forEach items="${wmList}" var="wm">
						<option value="${wm.groupCode}"
						<c:if test="${param._warehouseCode eq wm.groupCode}">selected=selected</c:if>
						>${wm.groupName}</option>
					</c:forEach>
				</select>
				
				<label style="margin-left: 10px;">任务状态:</label>
				<select class="input-medium"  id="_status" name="_status">
				        <option value="" <c:if test="${_status eq ''}">selected="selected"</c:if>>全选</option>
				        <option value="3" <c:if test="${_status eq '3'}">selected="selected"</c:if>>待包装任务</option>
				        <option value="4,5" <c:if test="${_status eq '4,5'}">selected="selected"</c:if>>已包装任务</option>
				</select> 
				
				
				<label>&nbsp;&nbsp;&nbsp;创建时间&nbsp;&nbsp;&nbsp;从：</label> 
			 	<input type="text" name="_fromDate" id="_fromDate"   value="${param._fromDate}" style="margin-left: -10px; width: 130px;" readonly="readonly"
			 	  onFocus="WdatePicker({minDate:'#F{$dp.$D(\'_fromDate\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:false})" > 
			 	
			 	<label>至：</label> 
			 	<input type="text" name="_toDate" id="_toDate"  value="${param._toDate}" style="margin-left: -10px;width: 130px;" readonly="readonly"
			 	 onFocus="WdatePicker({minDate:'#F{$dp.$D(\'_toDate\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:false})" >
				
			    <button class="btn" type="submit" style="margin-left: 10px;">搜索</button>
		    </form>
		    
		   </td>
		</tr>
	</table>
	
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr>
			    <th>序号</th>
			    <th>任务编号</th>
			    <th>商家</th>
			    <th>仓库编码</th>
			    <th>批次类型</th>
			    <th>批次编号</th>
			    <th>拣货类型</th>
			    <th>订单数量</th>
			    <th>创建时间</th>
			    <th>指派人</th>
			    <th>执行人</th>
			    <th>任务状态</th>
			    <th>操作</th>
			</tr></thead>
		<tbody>
		<c:forEach items="${taskList}" var="t" varStatus="i">
			<tr>
			   <td>${i.count}</td>
			   <td>${t.taskCode}</td>
			   <td>${customer.customerName}</td>
			   <td>${t.warehouseCode}</td>
			   <td>
			    <c:if test="${t.batchType eq 'wms'}">商发宝</c:if>
			    <c:if test="${t.batchType eq 'tms'}">集发宝</c:if>
			    <c:if test="${t.batchType eq 'bms'}">分仓宝</c:if>
			   </td>
			   <td>${t.batchCode}</td>
			   <td>
			     <c:if test="${t.pickType eq 'single'}">单件</c:if>
			     <c:if test="${t.pickType eq 'multi'}">多件</c:if>
			   </td>
			   <td>${t.orderQty}</td>
			   <td>${fn:substring(t.createTime,0,19)}</td>
			   <td>${t.commander.realname}</td>
			   <td>${t.tasker.realname}</td>
			   <td>
			     <c:if test="${t.status eq '3'}"><font color=red>待包装</font></c:if>
			     <c:if test="${t.status eq '4'}"><font color=blue>已包装</font></c:if>
			     <c:if test="${t.status eq '5'}"><font color=blue>已包装</font></c:if>
			   </td>
			   <td>
			      <c:if test="${t.status eq '3'}">
			         <a href="${ctx}/pkgTask/toPkgPage/${t.id}" role="button"  class="btn btn-primary" >执行任务</a>
			      </c:if>
			      <c:if test="${t.status eq '4'}">
			         <a href="${ctx}/pkgTask/toPkgPage/${t.id}" role="button"  class="btn btn-info" >查看任务</a>
			      </c:if>
			      <c:if test="${t.status eq '5'}">
			         <a href="${ctx}/pkgTask/toPkgPage/${t.id}" role="button"  class="btn btn-info" >查看任务</a>
			      </c:if>
			      
			   </td>
			</tr>
		</c:forEach>
		</tbody>
	</table>

</body>
</html>
